<!--
 * @Description: Lisonglin[2:30 player]
 * @Date: 2021-08-10 11:31:33
 * @LastEditTime: 2021-08-12 15:08:41
 * @FilePath: \web\html\user_info.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智慧农业-用户信息</title>
    <link type="text/css" href="../css/user_info.css" rel="stylesheet">
    <script type="text/javascript">
        function Func(){
            var xmlhttp;
            var year=document.getElementById("query_year");
            var month=document.getElementById("query_month");
            var day=document.getElementById("query_day");
            if(window.XMLHttpRequest)
            {
                //code for IE7+,Firefox,Chrome,Opera,Safari
                xmlhttp=new XMLHttpRequest();
            }
            else
            {
                //code for IE6,IE5
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            xmlhttp.onreadystatechange=function()
            {
                if(xmlhttp.readyState==4 && xmlhttp.status==200)
                {
                    var ret=JSON.parse(xmlhttp.responseText);
                    if(ret.temp.length==0){
                        document.getElementById("#query_result").innerHTML="查询失败! 暂无该日数据记录！";
                    }
                    else{
                        for(var i=0;i<ret.temp.length;i++){
                            ret.temp[i]=parseFloat(ret.temp[i]);
                            ret.humi[i]=parseFloat(ret.humi[i]);
                            ret.light[i]=parseInt(ret.light[i]);
                        }
                        var tmp="查询成功！查询日期："+year.options[year.selectedIndex].value+"年"+month.options[month.selectedIndex].value+"月"+day.options[day.selectedIndex].value+"日";
                        document.getElementById("#query_result").innerHTML=tmp;
                        chart.series[0].update({data: ret.temp});
                        chart.series[1].update({data: ret.humi});
                    }
                }
                else{
                }
            }
            xmlhttp.open("GET","/cgi-bin/user_info.cgi?year="+year.options[year.selectedIndex].value+"&month="+month.options[month.selectedIndex].value+"&day="+day.options[day.selectedIndex].value,true);
            xmlhttp.send();
        }
    </script>
</head>
<body>
    <!-- 导航栏 -->
    <div>
        <ul class="nav">
            <li><a href="base_config.html">数据监测</a></li>
            <li><a href="query_data.html">查询数据</a></li>
            <li><a href="user_info.html">用户信息</a></li>
            <li><a href="login.html">切换账号</a></li>
        </ul>
    </div>
    <!-- 页面标题 -->
    <h1>智慧农业-操作记录</h1>
    <hr>
    <h3>查询日期中一天的人员操作记录</h3>
    <!-- 下拉菜单选择查询日期 -->   
    <form id="query_date">
        查询日期： 
        <select name="query_year" id="query_year" class="query_year">
            <option value="2018">2018</option>
            <option value="2019">2019</option>
            <option value="2020">2020</option>
            <option value="2021">2021</option>
        </select> 年
        <select name="query_month" id="query_month" class="query_month">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
        </select> 月
        <select name="query_day" id="query_day" class="query_day">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
            <option value="15">15</option>
            <option value="16">16</option>
            <option value="17">17</option>
            <option value="18">18</option>
            <option value="19">19</option>
            <option value="20">20</option>
            <option value="21">21</option>
            <option value="22">22</option>
            <option value="23">23</option>
            <option value="24">24</option>
            <option value="25">25</option>
            <option value="26">26</option>
            <option value="27">27</option>
            <option value="28">28</option>
            <option value="29">29</option>
            <option value="30">30</option>
            <option value="31">31</option>
        </select> 日&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="button" id="btn_submitdate" value="查询" onclick="Func()">
    </form>
    <!-- 查询结果 -->
    <h3 id="query_result"></h3>
    <textarea name="query_record" id="record" cols="50" rows="20">
        <p>111111111111</p>
        <p>222222222222</p>
        <p>333333333333</p>
        <p>111111111111</p>
        <p>222222222222</p>
        <p>333333333333</p>
        <p>111111111111</p>
        <p>222222222222</p>
        <p>333333333333</p>
        <p>111111111111</p>
        <p>222222222222</p>
    </textarea>
    </body>
</html>
